import request from '@/utils/request'
export const findAllList = (search) => 
    request({
        url: '/template',
        method: 'get',
        params: {
            offset: search.offset,
            limit: search.limit,
            tempName: search.tempName
        }
    })

export const removeTemplate = (id) =>
    request({
        url:'/template/' + id  ,
        method: 'delete'
    })

export const getTemplateById = (id) =>
    request({
        url:'/template/' + id,
        method: 'get'

    })   

    export const UpdateTemplate = (templateManagement) =>
    request({
        url:'/template' ,
        method: 'put',
        data:templateManagement
    })
    
export const addTemplate = (templateManagement) =>
    request({
        url:'/template' ,
        method: 'post',
        data:templateManagement
    })

    export const updateByTemplateFalse = (id) =>
    request({
        url:'/template/tempFalse/' + id ,
        method: 'put',
    })

    export const updateByTemplateTrue = (id) =>
    request({
        url:'/template/tempTrue/' + id ,
        method: 'put',
    })

    export const findByTempStart = () =>
    request({
        url:'/template/findByStart' ,
        method: 'get',
    })

    export const findTempByCrux = (event) =>
        request({
            url:'/template/findTempByCrux',
            method:'get',
            params : {
                tempCrux:event
            }
        })

